'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As BUTTON
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:1:12
Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
Dim rval As Integer 'Return value
Dim strCDDrive As String 'CD drive letter
Dim strCDDir As String 'CD directory
Dim strAPCDDir As String 'Approach 96 CD directory
Dim strSTCDDir As String 'SmartSuite 96 CD directory
Dim strCurDrive As String 'Current drive letter
Dim strCurDir As String 'Current directory
'Initializations
rval = 1
strCDDrive = ""
strAPCDDir = "\APPRCH96\EXTRA\OCX\WEBSTER\"
strSTCDDir = "\EXTRA\OCX\WEBSTER\"
strCurDrive = ""
strCurDir = ""
strCDDir = strAPCDDir 'Start by assuming an Approach CD Installation.
On Error 68 Goto WrongDrive 'Error # for changing to invalid drive.
On Error 76 Goto WrongDir 'Error # for changing to invalid directory.
rval = Messagebox(|The Webster browser ships with the CD-ROM versions of Approach 96 and SmartSuite 96.
Please verify the CD-ROM is in the drive before proceeding.|, 1, "Webster install")
If (rval = 1) Then 'User hit OK.
strCurDrive = Curdrive 'Get the current drive letter.
strCurDir = Curdir 'Get the current directory.
GetInfo:
strCDDrive = Inputbox("Enter your CD drive letter (e.g. D)", "Webster install", "D", 150, 150)
If(strCDDrive <> "") Then
ChangeDir:
Chdrive strCDDrive
Chdir strCDDir
rval = Shell("SETUP.EXE", 1)
Chdrive strCurDrive 'Change back to the original drive.
Chdir strCurDir 'Change back to the original directory.
rval = 1
rval = Messagebox("Click OK when your done installing the Webster browser..", 0, "Webster install")
If (rval = 1) Then 'User hit OK.
'Now we need to close the .APR and open it again.
rval = 1
rval = Messagebox("Click OK to close the Surfnet application. When you open it again, you will be able to use the Webster browser. If you choose Cancel, you won't be able to use the browser until you close Surfnet and open it again..", 1, "Webster install")
If (rval = 1) Then
CurrentDocument.Window.Close
End If
End If
Goto EndInstall
End If
Goto EndInstall
Else
Goto EndInstall
End If
'If the user entered an invalid drive letter.
WrongDrive:
rval = 1
rval = Messagebox("Drive " & strCDDrive & " is invalid. Please enter a valid drive letter.", 1, "Webster Install")
If (rval = 1) Then 'User hit ok.
Resume GetInfo
Else
Resume EndInstall
End If
'If the user entered a drive letter, but not the CDdrive letter.
WrongDir:
rval = 1
If(strCDDir = strSTCDDir) Then 'check to see if we've been here before
rval = Messagebox("Drive " & strCDDrive & " is not the CD-ROM drive or the Approach or SmarSuite CD-ROM is not in the drive. Retry?", 1, "Webster Install")
If (rval = 1) Then 'User hit ok.
strCDDir = strAPCDDir 'if the user wants another try, set the CD Directory back to Approach CD
Resume GetInfo
Else
Resume EndInstall
End If
Else
strCDDir = strSTCDDir 'if we couldn't find the Approach CD directory, try the SmartSuite CD directory